<?php $this->widget('bootstrap.widgets.BootAlert'); ?>
<h1><?php echo Yii::app()->user->eMail; ?></h1>
<p>
<?php 
$this->widget('bootstrap.widgets.BootButton', array(
    'label' => Yii::t('view', 'Update your personal information'),
    'type' => 'primary',
	'icon' => 'icon-user icon-white',
    'url' => array('/user/update'),
));

echo ' ';

$this->widget('bootstrap.widgets.BootButton', array(
    'label' => Yii::t('view', 'Change your password'),
    'type' => 'primary', 
	'icon' => 'icon-lock icon-white',
    'url' => array('/user/password'),
)); 

$this->widget('bootstrap.widgets.BootButton', array(
    'label' => Yii::t('view', 'Delete history'),
    'type' => 'danger', 
	'icon' => 'icon-trash icon-white',
    'url' => array('/user/databasecleanup'),
	'htmlOptions'=>array('class'=>'pull-right'),
));  
?>
</p>
<table class="table table-bordered table-striped">
	<tbody>
		<tr>
			<th><?php echo User::model()->getAttributeLabel('eMail'); ?></th>
			<td><?php echo $model->eMail; ?></td>
		</tr>
		<?php if($model->firstName) {?>
		<tr>
			<th><?php echo User::model()->getAttributeLabel('firstName'); ?></th>
			<td><?php echo $model->firstName; ?></td>
		</tr>
		<?php } ?>
		<?php if($model->lastName) {?>
		<tr>
			<th><?php echo User::model()->getAttributeLabel('lastName'); ?></th>
			<td><?php echo $model->lastName; ?></td>
		</tr>
		<?php } ?>
		<tr>
			<th><?php echo User::model()->getAttributeLabel('created'); ?></th>
			<td><?php echo $model->created; ?></td>
		</tr>
		<?php if($model->edited) {?>
		<tr>
			<th><?php echo User::model()->getAttributeLabel('edited'); ?></th>
			<td><?php echo $model->edited; ?></td>
		</tr>
		<?php } ?>
		<tr>
			<th><?php echo User::model()->getAttributeLabel('entryCount'); ?></th>
			<td>
			<?php 
				if ($overallEntryCount > 0) {
					$percentage = round($entryCount*100/$overallEntryCount, 2);
				} else {
					$percentage = 0;
				}
				
				echo Yii::t('view', '{entryCount} of {overallEntryCount} ({percentage}%)', array('{entryCount}'=>$entryCount, '{overallEntryCount}'=>$overallEntryCount, '{percentage}'=>$percentage)); 
			?>
			</td>
		</tr>
	</tbody>
</table>
